package com.wxm.china.port.dds.utils;

import lombok.Data;

import java.io.Serializable;

@Data
public class DdsR<T> implements Serializable {
    private Integer code;
    private T data;
    private String msg;

    public static <T> DdsR<T> ok(T data){
        DdsR<T> r = new DdsR<>();
        r.setCode(200);
        r.setData(data);
        r.setMsg("成功");
        return r;
    }

    public static <T> DdsR<T> error(String msg){
        DdsR<T> r = new DdsR<>();
        r.setCode(500);
        r.setData(null);
        r.setMsg(msg);
        return r;
    }
}
